import { createApp } from 'vue'
import App from './App.vue'
const app = createApp(App)

// Router
import router from './router'
app.use(router)

// Element
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import 'element-plus/theme-chalk/dark/css-vars.css'
import locale from 'element-plus/es/locale/lang/zh-cn'
app.use(ElementPlus, {
    locale: locale,
    size: 'default'
})

// 全局样式
import '@/assets/styles/index.less';

// svg图标
import 'virtual:svg-icons-register'

// Piana
import store, { registerStore } from '@/stores'
app.use(store)
registerStore()

// 指令
import directive from '@/directive'
directive(app)

// 全局组件
import components from '@/components/index'
app.use(components)

// 全局方法
import api from "@/api";
import http from "@/utils/http";
import * as utils from "@/utils";
import * as validate from "@/utils/validate";
import modal from '@/utils/modal'
import { Local , Session } from '@/utils/storage'
import { resetForm } from '@/utils/app'

app.config.globalProperties.$A = api
app.config.globalProperties.$H = http
app.config.globalProperties.$U = utils
app.config.globalProperties.$V = validate  //验证方法
app.config.globalProperties.$M = modal  // 模态框对象
app.config.globalProperties.$SessionStorage = Session
app.config.globalProperties.$LocalStorage = Local
app.config.globalProperties.resetForm = resetForm

// 挂载
app.mount('#app')

